<!DOCTYPE html>
<html>

<head>

    <meta charset="utf-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">


    <title></title>
    <meta name="keywords" content="">
    <meta name="description" content="">

    <link rel="shortcut icon" href="favicon.ico">
    <link href="/css/bootstrap.min.css?v=3.3.6" rel="stylesheet">
    <link href="/css/font-awesome.css?v=4.4.0" rel="stylesheet">

    <link href="/css/animate.css" rel="stylesheet">
    <link href="/css/style.css?v=4.1.0" rel="stylesheet">

</head>

<body class="gray-bg">
<div class="wrapper wrapper-content animated fadeInRight">
    <div class="row">
        <div class="col-sm-12">
            <div class="ibox float-e-margins">
                <div class="ibox-title">
                    <h5>奖池管理<small></small></h5>
                </div>
                <div class="ibox-content">
                    <div class="">
                        <a href="/ceb/giftPacks/create" class="btn btn-primary ">添加</a>
                    </div>

                    {{--搜索分页代码块--}}
                    <div class="row">
                       {{-- <label class="adha-pro-pagelable">每页显示</label>--}}
                        <form action="" method="get">
                            <div class="col-sm-2 m-b-xs">
                                <div class="input-group">
                                    <input placeholder="开始日期" class="form-control layer-date" readonly id="start">
                                </div>
                            </div>
                            <div class="col-sm-2 m-b-xs">
                                <div class="input-group">
                                    <input placeholder="结束日期" readonly  class="form-control layer-date" id="end">
                                </div>
                            </div>

                            <div class="col-sm-3">
                                <div class="input-group">
                                 {{--   <input name="searchVal" value="@if(!empty($searchVal)){{$searchVal}}@endif"
                                           type="text" placeholder="请输入关键词" class="input-sm form-control"><span class="input-group-btn">
                                            <button type="submit" class="btn btn-sm btn-primary"> 搜索</button></span>--}}
                                    <button type="submit" class="btn btn-sm btn-primary"> 搜索</button>
                                </div>
                            </div>
                        </form>
                    </div>


                    <table class="table table-striped table-bordered table-hover">
                        <thead>
                        <tr>
                            <th>ID</th>
                            <th>奖池名称</th>
                            <th>总金额</th>
                            <th>生效时间</th>
                            <th>实效时间</th>
                            <th>关联活动</th>
                            <th>关联群体</th>
                            <th>已发放</th>
                            <th>已使用</th>
                            <th>总投资</th>
                            <th>操作</th>
                        </tr>
                        </thead>
                        <tbody>
                        <tr class="gradeA">
                            <td>1</td>
                            <td>1</td>
                            <td>1</td>
                            <td>1</td>
                            <td>1</td>
                            <td>1</td>
                            <td>1</td>
                            <td>1</td>
                            <td>1</td>
                            <td>1</td>
                            <td class="center">
                                <a href="/ceb/giftPacks/edit?pmId=1">编辑</a>
                                <a href="javascript:void(0);" class="delete-product" data-value="1" data-title="1">|删除</a>
                            </td>
                        </tr>

                        </tbody>
                        <tfoot>
                            <tr>
                                <th>ID</th>
                                <th>名称</th>
                                <th>总金额</th>
                                <th>生效时间</th>
                                <th>实效时间</th>
                                <th>关联活动</th>
                                <th>关联群体</th>
                                <th>已发放</th>
                                <th>已使用</th>
                                <th>总投资</th>
                                <th>操作</th>
                            </tr>
                        </tfoot>
                    </table>
                    {{--分页--}}
                    <div>
                        <div class="pull-right">
                           {{-- {{ $permissions->appends(['pageSize'=>$pageSize])->render()  }}--}}
                        </div>
                    </div>
                </div>
            </div>
        </div>
    </div>

</div>

<!-- 全局js -->
<script src="/js/jquery.min.js?v=2.1.4"></script>
<script src="/js/bootstrap.min.js?v=3.3.6"></script>

<script src="/js/plugins/layer/layer.min.js"></script>


<!-- layerDate plugin javascript -->
<script src="/js/plugins/layer/laydate/laydate.js"></script>

<!-- Page-Level Scripts -->
<script>
    $(document).ready(function () {

        $('.delete-product').click(function () {
            var docuElem=$(this);
            var permissionId=docuElem.data('value');
            var title=docuElem.data('title');
            if(window.confirm('你确定删除'+ title+ '？')){
                //继续执行
                $.ajaxSetup({
                    headers: { 'X-CSRF-TOKEN' : '{{ csrf_token() }}' }
                });
                $.ajax({
                    type:'post',
                    url:'{{ url('/admin/permission/delete') }}',
                    dataType:'json',
                    data:{permissionId:permissionId},
                    success: function(data){
                        data=eval(data);
                        if(data.code==200){
                            layer.msg(data.message, {icon: 6});
                            docuElem.parents('.gradeA').remove();
                        }else{
                            layer.msg(data.message, {icon: 5});
                        }
                    }
                });
            }
        });
        //====
        $("select[name='pageSize']").change(function () {
            $('form').submit();
        });



        //日期范围限制
        var start = {
            elem: '#start',
            format: 'YYYY-MM-DD',
          /*  min: laydate.now(),*/ //设定最小日期为当前日期
            max: '2099-06-16 23:59:59', //最大日期
            istime: true,
            istoday: false,
            choose: function (datas) {
                end.min = datas; //开始日选好后，重置结束日的最小日期
                end.start = datas //将结束日的初始值设定为开始日
            }
        };
        var end = {
            elem: '#end',
            format: 'YYYY-MM-DD',
          /*  min: laydate.now(),*/
            max: '2099-06-16 23:59:59',
            istime: true,
            istoday: false,
            choose: function (datas) {
                start.max = datas; //结束日选好后，重置开始日的最大日期
            }
        };
        $("#start").click(function () {
            laydate(start);
        });
        $("#end").click(function () {
            laydate(end);
        });

    });

</script>

</body>

</html>
